

package com.wake.widget.widget.roundwidget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;

import com.wake.widget.R;
import com.wake.widget.util.NMUIViewHelper;

/**
 * 见 {@link NMUIRoundButton} 与 {@link NMUIRoundButtonDrawable}
 */
public class NMUIRoundLinearLayout extends LinearLayout {

    public NMUIRoundLinearLayout(Context context) {
        super(context);
        init(context, null, 0);
    }

    public NMUIRoundLinearLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context, attrs, R.attr.NMUIButtonStyle);
    }

    public NMUIRoundLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context, attrs, defStyleAttr);
    }

    private void init(Context context, AttributeSet attrs, int defStyleAttr) {
        NMUIRoundButtonDrawable bg = NMUIRoundButtonDrawable.fromAttributeSet(context, attrs, 0);
        NMUIViewHelper.setBackgroundKeepingPadding(this, bg);
    }
}
